﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using Nauka.engine;

namespace Nauka.GUI
{
    public partial class StatisticsConfigurationWindow : Form
    {
        MainProgram mp;

        public StatisticsConfigurationWindow(MainProgram mp)
        {
            this.mp = mp;
            InitializeComponent();
            ArrayList limits = mp.dbconn.getLimits();
            foreach(string s in limits)
            {
            }
            setDefault();
            apply();
        }

        private void setDefault()
        {
            this.handsCheckBox.Checked = true;
            this.VPIPCheckBox.Checked = true;
            this.VPIP_SBCheckBox.Checked = false;
            this.PFRCheckBox.Checked = true;
            this.AFCheckBox.Checked = true;
            this.AF_FlopCheckBox.Checked = false;
            this.AF_TurnCheckBox.Checked = false;
            this.AF_RiverCheckBox.Checked = false;
            this.WTSCheckBox.Checked = true;
            this.WTSwsFCheckBox.Checked = true;
            this.AmounthhCheckBox.Checked = false;
            this.BBhhCheckBox.Checked = false;
            this.Amount100CheckBox.Checked = false;
            this.BB100CheckBox.Checked = true;
            this.AmountWonCheckBox.Checked = true;
            this.BBwonCheckBox.Checked = true;
            this.WonwsFCheckBox.Checked = true;
            this.SawFlopCheckBox.Checked = false;
            this.WaSCheckBox.Checked = true;
            this.StealAttemptCheckBox.Checked = true;
            this.FoldRiverCheckBox.Checked = false;
            this.FoldTurnCheckBox.Checked = false;
            this.FoldFlopCheckBox.Checked = false;
            this.FoldPreflopCheckBox.Checked = false;
            this.minutesPlayedCheckBox.Checked = false;
            this.HeroNameTextBox.Text = mp.statsFilter.hero;
        }

        private void Defaultbutton_Click(object sender, EventArgs e)
        {
            setDefault();
        }

        private void apply()
        {
            mp.statsFilter.hero = HeroNameTextBox.Text;
            mp.statsFilter.hands = handsCheckBox.Checked;
            mp.statsFilter.VPIP = VPIPCheckBox.Checked;
            mp.statsFilter.VPIP_SB = VPIP_SBCheckBox.Checked;
            mp.statsFilter.PFR = PFRCheckBox.Checked;
            mp.statsFilter.AF = AFCheckBox.Checked;
            mp.statsFilter.AF_Flop = AF_FlopCheckBox.Checked;
            mp.statsFilter.AF_Turn = AF_TurnCheckBox.Checked;
            mp.statsFilter.AF_River = AF_RiverCheckBox.Checked;
            mp.statsFilter.WTS = WTSCheckBox.Checked;
            mp.statsFilter.WTSwsF = WTSwsFCheckBox.Checked;
            mp.statsFilter.Amounthh = AmounthhCheckBox.Checked;
            mp.statsFilter.BBhh = BBhhCheckBox.Checked;
            //mp.statsFilter.Amount100 = Amount100CheckBox.Checked;
            mp.statsFilter.BB100 = BB100CheckBox.Checked;
            mp.statsFilter.AmountWon = AmountWonCheckBox.Checked;
            mp.statsFilter.BBwon = BBwonCheckBox.Checked;
            //mp.statsFilter.WonwsF = WonwsFCheckBox.Checked;
            mp.statsFilter.WaS = WaSCheckBox.Checked;
            mp.statsFilter.SawFlop = SawFlopCheckBox.Checked;
            mp.statsFilter.StealAttempt = StealAttemptCheckBox.Checked;
            mp.statsFilter.FoldRiver = FoldRiverCheckBox.Checked;
            mp.statsFilter.FoldTurn = FoldTurnCheckBox.Checked;
            mp.statsFilter.FoldFlop = FoldFlopCheckBox.Checked;
            mp.statsFilter.FoldPreflop = FoldPreflopCheckBox.Checked;
            mp.statsFilter.minutesPlayed = minutesPlayedCheckBox.Checked;
        }

        private void Applybutton_Click(object sender, EventArgs e)
        {
            apply();
        }

        private void CancelButton_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void OKbutton_Click(object sender, EventArgs e)
        {
            apply();
            this.Dispose();
        }


    }
}
